package com.huawei.gamebox.service.common.cardkit.card;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.widget.LineImageView;
import com.huawei.gamebox.service.common.cardkit.bean.BannerEntryCardBean;
import com.huawei.gamebox.service.common.cardkit.bean.MultiEntriesCardBean;
import o.azb;
import o.cgz;
import o.chy;
import o.eqx;
import o.exp.d;

public class BannerEntryCard extends BaseGsCard {
    private Context ˋ;
    private LineImageView ˏ = null;

    public BannerEntryCard(Context context) {
        super(context);
        this.ˋ = context;
    }

    public void ˏ(CardBean cardBean) {
        LayoutParams layoutParams;
        LayoutParams layoutParams2 = (LinearLayout.LayoutParams) this.ˏ.getLayoutParams();
        if (layoutParams2 == null) {
            layoutParams = new LinearLayout.LayoutParams(-1, -2);
        } else {
            layoutParams = layoutParams2;
        }
        layoutParams.width = azb.ॱ(this.ˋ);
        MultiEntriesCardBean multiEntriesCardBean = (MultiEntriesCardBean) cardBean;
        if (multiEntriesCardBean.ˊ() != null && multiEntriesCardBean.ˊ().size() != 0) {
            String ˑॱ;
            BannerEntryCardBean bannerEntryCardBean = (BannerEntryCardBean) multiEntriesCardBean.ˊ().get(0);
            bannerEntryCardBean.ˋˋ(multiEntriesCardBean.ॱˉ());
            if (2 == this.ˋ.getResources().getConfiguration().orientation) {
                ˑॱ = bannerEntryCardBean.ˑॱ();
                layoutParams.height = layoutParams.width / 6;
            } else {
                ˑॱ = bannerEntryCardBean.ॱˌ();
                layoutParams.height = layoutParams.width / 3;
            }
            this.ˏ.setLayoutParams(layoutParams);
            eqx.ˎ(this.ˏ, ˑॱ);
            this.ˏ.setTag(bannerEntryCardBean);
        }
    }

    public cgz ˏ(View view) {
        this.ˏ = (LineImageView) view.findViewById(d.ॱˋ);
        ʽ(view);
        return this;
    }

    public void ॱ(chy o_chy) {
        this.ˏ.setOnClickListener(ʽ());
    }
}
